<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改用户')" />
	<th:block th:include="include :: select2-css" />
</head>
<body>
<div class="main-content">
	<form class="form-horizontal" id="form-taskfinish-edit" th:object="${task}">
		<input id="taskId" name="taskId"  type="hidden"  th:field="*{taskId}" />
		<h4 class="form-header h4">任务详情</h4>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label"><span style="color: red; ">*</span>任务标题：</label>
					<div class="col-sm-8">
						<input   class="form-control" type="text" th:field="*{taskTitle}">
					</div>
				</div>
			</div>


			<input type="hidden" id="taskType" th:value="*{taskType}" required>
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label"><span style="color: red; ">*</span>紧急程度：</label>
					<div class="col-sm-8" id="labtype">
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label">执行人员：</label>
					<div class="col-sm-8">
						<input  class="form-control" type="text"  th:field="*{taskUser}">
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label">创建时间：</label>
					<div class="col-sm-8">
						<input class="form-control" type="text" th:field="*{taskCreateTime}">
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label">任务开始时间：</label>
					<div class="col-sm-8">
						<input  class="form-control" type="text" th:field="*{taskStartTime}">
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label"><span style="color: red; ">*</span>任务完成时间：</label>
					<div class="col-sm-8">
						<input  class="form-control" type="text"  th:field="*{taskStopTime}">
					</div>
				</div>
			</div>
		</div>

		<h4 class="form-header h4">任务内容</h4>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-xs-2 control-label">任务内容：</label>
					<div class="col-xs-10">
						<textarea  maxlength="300" class="form-control" rows="3">[[*{taskContent}]]</textarea>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group">
					<label class="col-xs-2 control-label">完成情况：</label>
					<div class="col-xs-10">
						<textarea name="taskSituation" maxlength="200" class="form-control" rows="3">[[*{taskSituation}]]</textarea>
					</div>
				</div>
			</div>
		</div>

		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label">任务状态：</label>
					<div class="col-sm-8">
						<select name="taskStatus" class="form-control m-b" th:with="type=${@dict.getType('task_status')}">
							<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{taskStatus}"></option>
						</select>
					</div>
				</div>
			</div>
		</div>

	</form>
</div>
<div class="row">
	<div class="col-sm-offset-5 col-sm-10">
		<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
		<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script type="text/javascript">
	var prefix = ctx + "schedule/taskfinish";

	function submitHandler() {
		if ($.validate.form()) {
			var data = $("#form-taskfinish-edit").serialize();
			$.operate.saveTab(prefix + "/edit", data);
		}
	}



	$(function() {
		/*$('#post').select2({
			placeholder: "请选择岗位",
			allowClear: true
		});*/

		var lab = $("#taskType").val();

		if(lab=="0"){
			$("#labtype").append("<input class=\"form-control\" type=\"text\" value='一般' required>");

		}
		if(lab==1){
			$("#labtype").append("<input class=\"form-control\" type=\"text\"  value='紧急' required>");
		}
		if(lab==2){
			$("#labtype").append("<input class=\"form-control\" type=\"text\"  value='非常紧急' required>");
		}
	})
</script>
</body>
</html>